

  
 <?php
 require_once ("include/header.php");
 
 $cata = 'Watches' ;
 
 
                   // making advert.
               $ObjRegister= new RegistedUser() ;
               
               	if(isset($_POST['Submit']) && !empty($_POST['Submit']) ){
                   
			$realName = $_FILES['sora']['name'];
		$uploadPath = "sewar/users/".$realName ;
	$tempFile=$_FILES['sora']['tmp_name'];
	move_uploaded_file($tempFile,$uploadPath) ;
	   $ObjRegister->advertisment($cata, $_POST['title1'], $_POST['desc'], $uploadPath, 
                   $_POST['price'], $_POST['Email'], $_POST['City'], $_POST['Phone1']) ;
		  
		  // @header("location:register.php");
                    
		   }
                   
                   
                   // Quearing all Data 
                   $sql = "SELECT * FROM  adverts  WHERE category  LIKE '%Watches%'";
			$result = mysql_query($sql);
			
			while($row = mysql_fetch_array($result))
			{
	      
				$_SESSION['product_id'] = $row['ID'];
				$_SESSION['category'] = $row['category'];
				$_SESSION['title'] = $row['title'];
                               $_SESSION['desc']  = $row['descreption'];
                               $_SESSION['userImage']= $row['image'];
                              $_SESSION['eemail'] = $row['email'];
                              $_SESSION['price']  = $row['price'];
                               $_SESSION['city'] = $row['city']; 
                                $_SESSION['phone'] = $row['phone'] ;
                               $_SESSION['$signup_date'] = $row['signup_date'] ;
                              echo '<div id="profile" style="margin-bottom:0px;margin-left:70px;">'  ;
                               echo '<img style=" margin-left:19px;padding-bottom:5px;" src="'.$_SESSION['userImage'].'" width="200" height="200" />'.'<br/>';
                              
                                echo ' *  TITle : ' . $_SESSION['title'].'<br/>';
                                 echo ' *  Descreption : ' . $_SESSION['desc'].'<br/>';
                                 echo ' *  Price : ' . $_SESSION['price'].'<br/>';
                               echo ' *  E_mail: ' . $_SESSION['eemail'].'<br/>';
                               echo ' *  City : ' . $_SESSION['city'].'<br/>';
                               echo ' *  Phone : ' . $_SESSION['phone'].'<br/>';
                                echo ' *  ID : ' . $_SESSION['product_id'].'<br/>';
				echo ' *  UPloaded from : '. $_SESSION['$signup_date'].'<br/>';
                              echo   '</div> '  ;
                             
                        }
								echo '  <div id="clear"></div>';
          		 require_once ("AdsForm.php");
?>
 
        
                     <?php
  require_once("include/SideBar.php");
   require_once ("include/Footer.php");
   ?>